# *-* coding: utf-8 *-*
#
#       youtube_syncronizer
#       
#       Copyright 2009 Frederico Rodrigues Chevitarese <fchevitarese@gmail.com>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

from django.db import models
from django.utils.translation import ugettext_lazy as _

class new_feed(models.Model):
    feed_user = models.CharField(_('User feed'), max_length = 80, help_text = _('Input the channel name'))
    
    def __unicode__(self):
        return self.feed_user
    
    class Meta:
        db_table = 'django_youtubesync_feed'
        verbose_name_plural = ('Youtube Sync - User feed')
        
class video_data(models.Model):
    videoChannel = models.ForeignKey(new_feed)
    title = models.CharField(_('Video title'), max_length = 150, blank = True)
    published = models.DateField(_('Date published'), blank = True)
    description = models.TextField(_('Video description'), blank = True)
    category = models.CharField(_('Video category'), max_length = 50, blank = True)
    duration = models.CharField(_('Video duration'), max_length = 30, blank = True)
    url = models.URLField(_('Video url'), verify_exists = False, max_length = 150, unique = True)
    embededCode = models.TextField(_('Embeded Code'), help_text = _("Don't touch this ;)"), blank = True)
    
    def __unicode__(self):
        return self.title
    
    class Meta:
        db_table = 'django_youtubesync_videos'
        verbose_name_plural = _('Youtube Sync - Video list')